package Heap;

import java.util.Arrays;

public class Text {

    public static void main(String[] args) {
        int[] arr = new int[]{2,3,1,7,6,4,5};
        MyHeap heap = new MyHeap(arr);
        System.out.println(Arrays.toString(heap.arr));

        while (heap.size > 1) {
            heap.swap(0, heap.size - 1);
            heap.size--;
            heap.down(0);
        }
        System.out.println(Arrays.toString(heap.arr));
    }

    public static void main2(String[] args) {
        MyHeap heap = new MyHeap(10);
        heap.offer(1);
        heap.offer(2);
        heap.offer(3);
        heap.offer(4);
        heap.offer(5);
        heap.traverse();
    }
    public static void main1(String[] args) {
        MyHeap myHeap = new MyHeap(new int[]{1,2,3,4,5,6,7});
        myHeap.offer(8);
        myHeap.traverse();

/*        myHeap.traverse();
        myHeap.poll(6);
        myHeap.traverse();*/
    }
}
